﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;


namespace Danser_Entity.Entities
{
    /// <summary>
    /// holds information about a validation template in the DB
    /// </summary>
    public class ValidationTemplate
    {
        #region Members:

        private int id;
        private string name;
        private bool appliedOnDefault;
        private String mailList;
        private string expression; //the expression representing the validation rule

        #endregion

        #region C'tors:

        /// <summary>
        /// creates an empty ValidationTemplate instance
        /// </summary>
        public ValidationTemplate() { }

        /// <summary>
        /// creates a validation template instamce according to the given parameters
        /// </summary>
        /// <param name="name"></param>
        /// <param name="appliedOnDefault"></param>
        /// <param name="mailList"></param>
        /// <param name="expression"></param>
        public ValidationTemplate(
            string name,
            bool appliedOnDefault,
            String mailList,
            string expression)
        {
            this.name = name;
            this.appliedOnDefault = appliedOnDefault;
            this.mailList = mailList;
            this.expression = expression;
        }
        /// <summary>
        /// creates a validation template instamce according to the given parameters
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="appliedOnDefault"></param>
        /// <param name="mailList"></param>
        /// <param name="expression"></param>
        public ValidationTemplate(
            int id, 
            string name,
            bool appliedOnDefault,
            String mailList,
            string expression)

            : this(name, appliedOnDefault, mailList, expression)
        {
            this.id = id;
        }

        #endregion

        #region Properties:

        /// <summary>
        /// property
        /// </summary>
        public int ID
        {
            get { return id; }
            set { id = value; }
        }

        /// <summary>
        /// property
        /// </summary>
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// property
        /// </summary>
        public bool AppliedOnDefault
        {
            get { return appliedOnDefault; }
            set { appliedOnDefault = value; }
        }

        /// <summary>
        /// property
        /// </summary>
        public String MailList
        {
            get { return mailList; }
            set { mailList = value; }
        }

        /// <summary>
        /// property
        /// </summary>
        public string Expression
        {
            get { return expression; }
            set { expression = value; }
        }

        #endregion
    }
}
